home *** CD-ROM | disk | FTP | other *** search
/ Geek Games #12 / GEGA012.iso / Jogos de Azar / pokersuperstars.swf / scripts / frame_1 / DoAction_2.as next >
Text File  |  2006-01-17  |  35KB  |  1,022 lines

  1. function AllinScreen()
  2. {
  3.    mygame.mybubble.killBubble(5);
  4.    mygame.mybubble.killBubble(6);
  5.    this.mydepth = 0;
  6.    this.dpbox = new Object();
  7.    this.dpbox.y = 2;
  8.    this.dpbox.b2 = {x0:129.8,x1:359.8};
  9.    this.dpbox.b3 = {x0:69.8,x1:244.8,x2:419.8};
  10.    this.dpbox.b4 = {x0:29.8,x1:173.1,x2:316.4,x3:459.7};
  11.    this.dpbox.b5 = {x0:9.8,x1:127.3,x2:244.8,x3:362.3,x4:479.8};
  12.    createEmptyMovieClip("allin",_root.allindepth);
  13.    allin.attachMovie("bkgdAllin","bkgdAllin",this.mydepth++);
  14.    this.mydepth = this.mydepth + 1;
  15.    this.push3 = false;
  16.    this.hp = mygame.myhand.handPlayers;
  17.    this.party = new Array();
  18.    var _loc4_ = 0;
  19.    while(_loc4_ < this.hp.length)
  20.    {
  21.       if(this.hp[_loc4_] != "f" && this.hp[_loc4_] != "e")
  22.       {
  23.          if(this.hp[_loc4_] == 3)
  24.          {
  25.             this.push3 = true;
  26.          }
  27.          else
  28.          {
  29.             this.party.push(this.hp[_loc4_]);
  30.          }
  31.       }
  32.       _loc4_ = _loc4_ + 1;
  33.    }
  34.    if(this.push3 == true)
  35.    {
  36.       this.party.push(3);
  37.    }
  38.    var _loc5_ = "b" + this.party.length;
  39.    _loc4_ = 0;
  40.    while(_loc4_ < this.party.length)
  41.    {
  42.       var _loc3_ = this.party[_loc4_];
  43.       allin.attachMovie("playerBox","pBox" + _loc3_,this.mydepth++);
  44.       allin["pBox" + _loc3_]._x = this.dpbox[_loc5_]["x" + _loc4_];
  45.       allin["pBox" + _loc3_]._y = this.dpbox.y;
  46.       allin["pBox" + _loc3_]._xscale = 85;
  47.       allin["pBox" + _loc3_]._yscale = 85;
  48.       allin["pBox" + _loc3_].cover._visible = false;
  49.       allin["pBox" + _loc3_].highlite._visible = false;
  50.       allin["pBox" + _loc3_].statusBox.display.text = table["pBox" + _loc3_].statusBox.display.text;
  51.       allin["pBox" + _loc3_].myname.text = table["pBox" + _loc3_].myname.text;
  52.       if(_loc3_ == 3)
  53.       {
  54.          allin["pBox" + _loc3_].player.gotoAndStop("player");
  55.       }
  56.       else
  57.       {
  58.          allin["pBox" + _loc3_].player.gotoAndStop(allin["pBox" + _loc3_].myname.text);
  59.       }
  60.       this.c0 = arena["card_" + _loc3_ + "_0"]._currentframe;
  61.       this.c1 = arena["card_" + _loc3_ + "_1"]._currentframe;
  62.       allin.attachMovie("card","card_" + _loc3_ + "_0",this.mydepth++);
  63.       allin.attachMovie("card","card_" + _loc3_ + "_1",this.mydepth++);
  64.       allin["card_" + _loc3_ + "_0"].cardback._visible = false;
  65.       allin["card_" + _loc3_ + "_1"].cardback._visible = false;
  66.       allin["card_" + _loc3_ + "_0"].gotoAndStop(this.c0);
  67.       allin["card_" + _loc3_ + "_1"].gotoAndStop(this.c1);
  68.       allin["card_" + _loc3_ + "_0"]._x = allin["pBox" + _loc3_]._x + 7;
  69.       allin["card_" + _loc3_ + "_0"]._y = allin["pBox" + _loc3_]._y + 120;
  70.       allin["card_" + _loc3_ + "_1"]._x = allin["card_" + _loc3_ + "_0"]._x + 30;
  71.       allin["card_" + _loc3_ + "_1"]._y = allin["card_" + _loc3_ + "_0"]._y + 5;
  72.       _loc4_ = _loc4_ + 1;
  73.    }
  74.    allin.bkgdAllin.potAmount.pot.text = arena.potBox.balance.text;
  75.    this.numComm = 0;
  76.    if(mygame.myhand.dealType[0] == "turn")
  77.    {
  78.       this.numComm = 3;
  79.    }
  80.    else if(mygame.myhand.dealType[0] == "river")
  81.    {
  82.       this.numComm = 4;
  83.    }
  84.    else if(mygame.myhand.dealType[0] == "end")
  85.    {
  86.       this.numComm = 5;
  87.    }
  88.    if(this.numComm > 0)
  89.    {
  90.       _loc4_ = 0;
  91.       while(_loc4_ < this.numComm)
  92.       {
  93.          this.c0 = arena["card_comm_" + _loc4_]._currentframe;
  94.          allin.attachMovie("card","card_comm_" + _loc4_,this.mydepth++);
  95.          allin["card_comm_" + _loc4_].cardback._visible = false;
  96.          allin["card_comm_" + _loc4_].gotoAndStop(this.c0);
  97.          allin["card_comm_" + _loc4_]._x = 127 + 70 * _loc4_;
  98.          allin["card_comm_" + _loc4_]._y = 228;
  99.          _loc4_ = _loc4_ + 1;
  100.       }
  101.    }
  102.    if(this.numComm < 5)
  103.    {
  104.       this.dealCommunityCards();
  105.    }
  106.    else
  107.    {
  108.       this.newEndProcess();
  109.    }
  110. }
  111. function sayGoodbye(pk)
  112. {
  113.    playerKill = new Array();
  114.    var _loc1_ = 0;
  115.    while(_loc1_ < pk.length)
  116.    {
  117.       playerKill.push(pk[_loc1_]);
  118.       _loc1_ = _loc1_ + 1;
  119.    }
  120.    gbcount = 0;
  121.    pkcount = 0;
  122.    mytry = 0;
  123.    killme = setInterval(goodbye,1400);
  124.    mygame.mybubble.makeBubble(6,"Let\'s thank our","eliminated players",3,2500);
  125. }
  126. function goodbye()
  127. {
  128.    if(pauseOn == false)
  129.    {
  130.       if(gbcount > 1)
  131.       {
  132.          var _loc4_ = playerKill[pkcount];
  133.          if(pkcount < playerKill.length)
  134.          {
  135.             if(mytry == 0)
  136.             {
  137.                mytry++;
  138.                PlaySoundEffect("SOUND_CLAP4");
  139.                var _loc7_ = table["pBox" + _loc4_].myname.text + " " + table["pBox" + _loc4_].mylastname;
  140.                mygame.mybubble.makeBubble(6,_loc7_,"blank",3,1500);
  141.                arena.attachMovie("infoBox","infoBox",_root.mygame.mydepth + 100);
  142.                arena.infoBox._x = 52;
  143.                arena.infoBox._y = 317;
  144.                arena.infoBox.myname.text = mygame.gPlayers["player" + _loc4_].first + " " + mygame.gPlayers["player" + _loc4_].last;
  145.                arena.infoBox.mytag.text = mygame.gPlayers["player" + _loc4_].lTag;
  146.             }
  147.             else
  148.             {
  149.                mytry = 0;
  150.                mygame.currentPlayers[_loc4_] = "e";
  151.                mygame.myhand.handPlayers[_loc4_] = "e";
  152.                table["pBox" + _loc4_]._visible = false;
  153.                table["pBox" + _loc4_].rank = mygame.finalrank[0];
  154.                mygame.finalrank.splice(0,1);
  155.                table["chipBox" + _loc4_].removeMovieClip();
  156.                arena.infoBox.removeMovieClip();
  157.                pkcount++;
  158.             }
  159.          }
  160.       }
  161.       gbcount++;
  162.       if(pkcount >= playerKill.length)
  163.       {
  164.          var _loc6_ = 0;
  165.          var _loc3_ = undefined;
  166.          var _loc5_ = false;
  167.          _loc3_ = 0;
  168.          while(_loc3_ < 5)
  169.          {
  170.             if(mygame.currentPlayers[_loc3_] == "e")
  171.             {
  172.                if(_loc3_ == 3)
  173.                {
  174.                   _loc5_ = true;
  175.                }
  176.                _loc6_ = _loc6_ + 1;
  177.             }
  178.             _loc3_ = _loc3_ + 1;
  179.          }
  180.          if(_loc6_ >= 4 && _loc5_ == false)
  181.          {
  182.             tableMenu.removeMovieClip();
  183.             mygame.myhand.getStandings("win");
  184.          }
  185.          else if(_loc5_ == true)
  186.          {
  187.             mygame.myhand.getStandings("lose");
  188.             tableMenu.removeMovieClip();
  189.          }
  190.          else if(_global.noZoneAPI == true)
  191.          {
  192.             trace("no zone");
  193.             trace(isGameTimerActive);
  194.             if(isGameTimerActive == true)
  195.             {
  196.                var _loc8_ = getTimer();
  197.                if(_loc8_ > gameStartTime + gametimer)
  198.                {
  199.                   if(timeraction == "allin")
  200.                   {
  201.                      botsDoAll = true;
  202.                      getDealStandings();
  203.                   }
  204.                   else
  205.                   {
  206.                      tableMenu.removeMovieClip();
  207.                      mygame.myhand.getStandings("expired");
  208.                   }
  209.                }
  210.                else
  211.                {
  212.                   getDealStandings();
  213.                }
  214.             }
  215.             else
  216.             {
  217.                trace(maxHandsAllowed + "  === " + numHandsPlayed);
  218.                if(maxHandsAllowed > 0)
  219.                {
  220.                   numHandsPlayed++;
  221.                   if(numHandsPlayed == maxHandsAllowed)
  222.                   {
  223.                      if(timeraction == "allin")
  224.                      {
  225.                         botsDoAll = true;
  226.                         getDealStandings();
  227.                      }
  228.                      else
  229.                      {
  230.                         tableMenu.removeMovieClip();
  231.                         mygame.myhand.getStandings("maxed");
  232.                      }
  233.                   }
  234.                   else
  235.                   {
  236.                      getDealStandings();
  237.                   }
  238.                }
  239.                else
  240.                {
  241.                   getDealStandings();
  242.                }
  243.             }
  244.          }
  245.          else if(gamebreaker > numHandsPlayedX + 1)
  246.          {
  247.             numHandsPlayedX++;
  248.             numHandsPlayed++;
  249.             getDealStandings();
  250.          }
  251.          else
  252.          {
  253.             numHandsPlayedX = 0;
  254.             DoGameBreak();
  255.          }
  256.          clearInterval(killme);
  257.       }
  258.    }
  259. }
  260. AllinScreen.prototype.dealCommunityCards = function()
  261. {
  262.    inc = 70;
  263.    if(mygame.myhand.dealType[0] == "flop")
  264.    {
  265.       num = 5;
  266.       toinc = 0;
  267.    }
  268.    else if(mygame.myhand.dealType[0] == "turn")
  269.    {
  270.       num = 2;
  271.       toinc = 3;
  272.    }
  273.    else if(mygame.myhand.dealType[0] == "river")
  274.    {
  275.       num = 1;
  276.       toinc = 4;
  277.    }
  278.    mygame.myhand.dealType.splice(0,1);
  279.    count = 0;
  280.    intID0015 = setInterval(this.doComm,1000);
  281. };
  282. AllinScreen.prototype.doComm = function()
  283. {
  284.    if(pauseOn == false)
  285.    {
  286.       PlaySoundEffect("SOUND_DEAL2");
  287.       var _loc1_ = "card_comm_" + mygame.myhand.commcardcount;
  288.       arena.attachMovie("card",_loc1_,mygame.myhand.mydepth++);
  289.       arena[_loc1_]._xscale = 75;
  290.       arena[_loc1_]._yscale = 75;
  291.       arena[_loc1_]._x = 140 + 50 * toinc;
  292.       arena[_loc1_]._y = 179;
  293.       allin.attachMovie("card","card_comm_" + mygame.myhand.commcardcount,myallin.mydepth++);
  294.       allin["card_comm_" + mygame.myhand.commcardcount].cardback._visible = false;
  295.       allin["card_comm_" + mygame.myhand.commcardcount].gotoAndStop(mygame.myhand.deck[cardcount]);
  296.       allin["card_comm_" + mygame.myhand.commcardcount]._x = 127 + 70 * toinc;
  297.       allin["card_comm_" + mygame.myhand.commcardcount]._y = 228;
  298.       arena[_loc1_].mycard = mygame.myhand.deck[cardcount];
  299.       arena[_loc1_].gotoAndStop(mygame.myhand.deck[cardcount]);
  300.       arena[_loc1_].cardback._visible = false;
  301.       toinc++;
  302.       count++;
  303.       cardcount++;
  304.       mygame.myhand.commcardcount = mygame.myhand.commcardcount + 1;
  305.       if(count >= num)
  306.       {
  307.          trace("count " + count + " ---- " + " num  " + num);
  308.          myallin.newEndProcess();
  309.          clearInterval(intID0015);
  310.       }
  311.    }
  312. };
  313. AllinScreen.prototype.newEndProcess = function()
  314. {
  315.    var _loc3_ = mygame.myhand.whosLeft();
  316.    k = 0;
  317.    while(k < _loc3_.length)
  318.    {
  319.       processHand(_loc3_[k]);
  320.       k++;
  321.    }
  322.    wArray = new Array();
  323.    k = 0;
  324.    while(k < _loc3_.length)
  325.    {
  326.       wArray.push({seat:_loc3_[k],a:_root["bestHand" + _loc3_[k]][0].a});
  327.       k++;
  328.    }
  329.    wArray.sortOn("a",18);
  330.    tie = checkForTies();
  331.    if(tie)
  332.    {
  333.       nameString = "";
  334.       k = 0;
  335.       while(k < numTies + 1)
  336.       {
  337.          _root["who" + k] = wArray[k].seat;
  338.          namestring += table["pBox" + _root["who" + k]].myname.text;
  339.          if(k < numTies)
  340.          {
  341.             namestring += ", ";
  342.          }
  343.          k++;
  344.       }
  345.       if(mygame.myhand.AllInActive > 0)
  346.       {
  347.          winnings = Math.floor(arena.potBox.bal / (numTies + 1));
  348.       }
  349.       else
  350.       {
  351.          winnings = Math.floor(arena.potBox.bal / (numTies + 1));
  352.       }
  353.       remainder = arena.potBox.bal - winnings * (numTies + 1);
  354.    }
  355.    else
  356.    {
  357.       mywho = wArray[0].seat;
  358.       winnerName = table["pBox" + mywho].myname.text;
  359.       winnerLastName = table["pBox" + mywho].mylastname;
  360.       winnings = arena.potBox.bal;
  361.    }
  362.    mygame.mybubble.makeBubble(10,"Lets see what","we got",1,1000);
  363.    intID0016 = setInterval(this.endComm,1500);
  364. };
  365. AllinScreen.prototype.endComm = function()
  366. {
  367.    count = 0;
  368.    playerIsInTheGame = false;
  369.    var _loc1_ = myallin.party.length - 1;
  370.    if(myallin.party[_loc1_] == 3)
  371.    {
  372.       playerIsInTheGame = true;
  373.       count = _loc1_;
  374.       myallin.finalCut();
  375.       myallin.party.splice(_loc1_,1);
  376.       count = 0;
  377.    }
  378.    else
  379.    {
  380.       myallin.finalCut();
  381.    }
  382.    intID0017 = setInterval(myallin.finalCut,3500);
  383.    clearInterval(intID0016);
  384. };
  385. AllinScreen.prototype.finalCut = function()
  386. {
  387.    if(pauseOn == false)
  388.    {
  389.       var _loc5_ = myallin.party[count];
  390.       if(allin["pBox" + _loc5_].myname.text != undefined)
  391.       {
  392.          var _loc2_ = 0;
  393.          while(_loc2_ < myallin.party.length)
  394.          {
  395.             allin["pBox" + myallin.party[_loc2_]].highlite._visible = false;
  396.             _loc2_ = _loc2_ + 1;
  397.          }
  398.          allin.pBox3.highlite._visible = false;
  399.          allin["pBox" + _loc5_].highlite._visible = true;
  400.          _loc2_ = 0;
  401.          while(_loc2_ < 5)
  402.          {
  403.             allin["card_comm_" + _loc2_].cardback._visible = true;
  404.             allin["card_" + _loc2_ + "_" + 0].cardback._visible = true;
  405.             allin["card_" + _loc2_ + "_" + 1].cardback._visible = true;
  406.             allin["card_comm_" + _loc2_].cardback.gotoAndStop(4);
  407.             allin["card_" + _loc2_ + "_" + 0].cardback.gotoAndStop(4);
  408.             allin["card_" + _loc2_ + "_" + 1].cardback.gotoAndStop(4);
  409.             _loc2_ = _loc2_ + 1;
  410.          }
  411.          highlightWinningCards(_loc5_,true);
  412.          var _loc4_ = _root["bestHand" + _loc5_][0].h[0];
  413.          var _loc3_ = "";
  414.          if(_loc4_ == 0)
  415.          {
  416.             PlaySoundEffect("SOUND_HIGHCARD");
  417.             _loc3_ = "HIGH CARD";
  418.          }
  419.          else if(_loc4_ == 1)
  420.          {
  421.             PlaySoundEffect("SOUND_PAIR");
  422.             _loc3_ = "PAIR";
  423.          }
  424.          else if(_loc4_ == 2)
  425.          {
  426.             PlaySoundEffect("SOUND_2PAIR");
  427.             _loc3_ = "TWO PAIR";
  428.          }
  429.          else if(_loc4_ == 3)
  430.          {
  431.             PlaySoundEffect("SOUND_3KIND");
  432.             _loc3_ = "3 of a Kind";
  433.          }
  434.          else if(_loc4_ == 4)
  435.          {
  436.             PlaySoundEffect("SOUND_STRAIGHT");
  437.             _loc3_ = "Straight";
  438.          }
  439.          else if(_loc4_ == 5)
  440.          {
  441.             PlaySoundEffect("SOUND_FLUSH");
  442.             _loc3_ = "Flush";
  443.          }
  444.          else if(_loc4_ == 6)
  445.          {
  446.             PlaySoundEffect("SOUND_FULLHOUSE");
  447.             _loc3_ = "Full House";
  448.          }
  449.          else if(_loc4_ == 7)
  450.          {
  451.             PlaySoundEffect("SOUND_4KIND");
  452.             _loc3_ = "4 of a Kind";
  453.          }
  454.          else if(_loc4_ == 8)
  455.          {
  456.             PlaySoundEffect("SOUND_STRAIGHTFLUSH");
  457.             _loc3_ = "Straight Flush";
  458.          }
  459.          else if(_loc4_ == 9)
  460.          {
  461.             PlaySoundEffect("SOUND_ROYALFLUSH");
  462.             _loc3_ = "Royal Flush";
  463.          }
  464.          allin["pBox" + _loc5_].statusBox.display.text = _loc3_;
  465.          allin["pBox" + _loc5_].statusBox.colorBox.gotoAndStop(1);
  466.          mygame.mybubble.makeBubble(10,allin["pBox" + _loc5_].myname.text + " has a",_loc3_,1,3000);
  467.       }
  468.       count++;
  469.       if(count > myallin.party.length)
  470.       {
  471.          trace("Announcing Winner");
  472.          count = 0;
  473.          intID0018 = setInterval(myallin.announceWinner,1000);
  474.          clearInterval(intID0017);
  475.       }
  476.    }
  477. };
  478. AllinScreen.prototype.announceWinner = function()
  479. {
  480.    if(pauseOn == false)
  481.    {
  482.       var _loc2_ = undefined;
  483.       if(!tie)
  484.       {
  485.          if(count == 0)
  486.          {
  487.             mygame.mybubble.makeBubble(10,"And the winner is...","blank",1,1500);
  488.          }
  489.          if(count == 2)
  490.          {
  491.             PlaySoundEffect("SOUND_CHEER");
  492.             mygame.mybubble.makeBubble(10,winnerName + "!","blank",1,1500);
  493.          }
  494.          if(count == 4)
  495.          {
  496.             mygame.mybubble.makeBubble("special","With a",_root["bestHand" + wArray[0].seat][0].t,1,2250);
  497.             arena.attachMovie("greentext","greentext",mygame.myhand.mydepth++);
  498.             arena.greentext._x = 178.6;
  499.             arena.greentext._y = 155.7;
  500.             arena.greentext.display.text = _root["bestHand" + wArray[0].seat][0].t;
  501.             arena.greentext.shadow.text = _root["bestHand" + wArray[0].seat][0].t;
  502.             k = 0;
  503.             while(k < 5)
  504.             {
  505.                allin["card_comm_" + k].cardback.gotoAndStop(4);
  506.                allin["card_" + k + "_" + 0].cardback.gotoAndStop(4);
  507.                allin["card_" + k + "_" + 1].cardback.gotoAndStop(4);
  508.                k++;
  509.             }
  510.             highlightWinningCards(mywho,true);
  511.             highlightWinningCards(mywho);
  512.             var k = 0;
  513.             while(k < myallin.party.length)
  514.             {
  515.                allin["pBox" + myallin.party[k]].highlite._visible = false;
  516.                allin["pBox" + myallin.party[k]].cover._visible = true;
  517.                allin["pBox" + myallin.party[k]].statusBox.display.text = "LOST";
  518.                allin["pBox" + myallin.party[k]].statusBox.colorBox.gotoAndStop(4);
  519.                k++;
  520.             }
  521.             if(playerIsInTheGame == true)
  522.             {
  523.                allin.pBox3.highlite._visible = false;
  524.                allin.pBox3.cover._visible = true;
  525.                allin.pBox3.statusBox.display.text = "LOST";
  526.                allin.pBox3.statusBox.colorBox.gotoAndStop(4);
  527.             }
  528.             allin.pBox3.highlite._visible = false;
  529.             allin["pBox" + mywho].highlite._visible = true;
  530.             allin["pBox" + mywho].cover._visible = false;
  531.             allin["pBox" + mywho].statusBox.display.text = "WINNER!";
  532.             allin["pBox" + mywho].statusBox.colorBox.gotoAndStop(3);
  533.          }
  534.          if(count == 6)
  535.          {
  536.             trace("trying to finish allin");
  537.             myallin.finishAllin();
  538.             clearInterval(intID0018);
  539.          }
  540.       }
  541.       else
  542.       {
  543.          if(count == 0)
  544.          {
  545.             mygame.mybubble.makeBubble(10,"And the winner is...","blank",1,1500);
  546.          }
  547.          if(count == 2)
  548.          {
  549.             mygame.mybubble.makeBubble(10,"Split Pot!","blank",1,1500);
  550.          }
  551.          if(count == 4)
  552.          {
  553.             PlaySoundEffect("SOUND_CLAP1");
  554.             mygame.mybubble.makeBubble("special","With a",_root["bestHand" + wArray[0].seat][0].t,1,1500);
  555.             arena.attachMovie("greentext","greentext",mygame.myhand.mydepth++);
  556.             arena.greentext._x = 180.6;
  557.             arena.greentext._y = 155.7;
  558.             arena.greentext.display.text = _root["bestHand" + wArray[0].seat][0].t;
  559.             arena.greentext.shadow.text = _root["bestHand" + wArray[0].seat][0].t;
  560.             _loc2_ = 0;
  561.             while(_loc2_ < myallin.party.length)
  562.             {
  563.                allin["pBox" + myallin.party[_loc2_]].highlite._visible = false;
  564.                allin["pBox" + myallin.party[_loc2_]].cover._visible = true;
  565.                allin["pBox" + myallin.party[_loc2_]].statusBox.display.text = "LOST";
  566.                allin["pBox" + myallin.party[_loc2_]].statusBox.colorBox.gotoAndStop(4);
  567.                _loc2_ = _loc2_ + 1;
  568.             }
  569.             if(playerIsInTheGame == true)
  570.             {
  571.                allin.pBox3.highlite._visible = false;
  572.                allin.pBox3.cover._visible = true;
  573.                allin.pBox3.statusBox.display.text = "LOST";
  574.                allin.pBox3.statusBox.colorBox.gotoAndStop(4);
  575.             }
  576.             allin.pBox3.highlite._visible = false;
  577.             _loc2_ = 0;
  578.             while(_loc2_ < numTies + 1)
  579.             {
  580.                allin["pBox" + wArray[_loc2_].seat].highlite._visible = true;
  581.                allin["pBox" + wArray[_loc2_].seat].cover._visible = false;
  582.                allin["pBox" + wArray[_loc2_].seat].statusBox.display.text = "WINNER!";
  583.                allin["pBox" + wArray[_loc2_].seat].statusBox.colorBox.gotoAndStop(3);
  584.                highlightWinningCards(wArray[_loc2_].seat,true);
  585.                highlightWinningCards(wArray[_loc2_].seat);
  586.                _loc2_ = _loc2_ + 1;
  587.             }
  588.          }
  589.          if(count == 7)
  590.          {
  591.             myallin.finishAllin();
  592.             clearInterval(intID0018);
  593.          }
  594.       }
  595.       count++;
  596.    }
  597. };
  598. AllinScreen.prototype.finishAllin = function()
  599. {
  600.    var _loc29_ = undefined;
  601.    trace("finishin allin");
  602.    var _loc3_ = undefined;
  603.    var _loc4_ = undefined;
  604.    var _loc5_ = undefined;
  605.    who = mywho;
  606.    PlaySoundEffect("SOUND_CLAP3");
  607.    var _loc28_ = mygame.myhand.whosLeft();
  608.    trace("ALL PLAYERS IN SHOWDOWN  " + _loc28_.length);
  609.    if(mygame.myhand.AllInActive > 2)
  610.    {
  611.       var _loc8_ = undefined;
  612.       var _loc7_ = new Array(new Array(),new Array(),new Array(),new Array(),new Array());
  613.       var _loc6_ = new Array();
  614.       _loc4_ = 0;
  615.       while(_loc4_ < 5)
  616.       {
  617.          if(mygame.myhand.AllInPool[_loc4_] > 0)
  618.          {
  619.             _loc6_.push({who:_loc4_,amt:mygame.myhand.AllInPool[_loc4_],a:0});
  620.          }
  621.          _loc4_ = _loc4_ + 1;
  622.       }
  623.       _loc4_ = 0;
  624.       while(_loc4_ < 5)
  625.       {
  626.          _loc5_ = 0;
  627.          while(_loc5_ < 5)
  628.          {
  629.             if(wArray[_loc4_].seat == _loc6_[_loc5_].who)
  630.             {
  631.                _loc6_[_loc5_].a = wArray[_loc4_].a;
  632.             }
  633.             _loc5_ = _loc5_ + 1;
  634.          }
  635.          _loc4_ = _loc4_ + 1;
  636.       }
  637.       _loc6_.sortOn("amt",18);
  638.       mygame.myhand.potStore[1] += mygame.myhand.basicPot;
  639.       if(mygame.myhand.AllInActive == 3)
  640.       {
  641.          if(numTies == 0)
  642.          {
  643.             _loc7_[0].push(wArray[0].seat);
  644.             _loc7_[1].push(wArray[0].seat);
  645.          }
  646.          else if(numTies == 1)
  647.          {
  648.             mygame.myhand.potStore[0] /= 2;
  649.             mygame.myhand.potStore[1] /= 2;
  650.             _loc7_[0].push(wArray[0].seat);
  651.             _loc7_[0].push(wArray[1].seat);
  652.             _loc7_[1].push(wArray[0].seat);
  653.             _loc7_[1].push(wArray[1].seat);
  654.          }
  655.          else if(numTies == 2)
  656.          {
  657.             mygame.myhand.potStore[0] /= 3;
  658.             mygame.myhand.potStore[1] /= 3;
  659.             _loc7_[0].push(wArray[0].seat);
  660.             _loc7_[0].push(wArray[1].seat);
  661.             _loc7_[0].push(wArray[2].seat);
  662.             _loc7_[1].push(wArray[0].seat);
  663.             _loc7_[1].push(wArray[1].seat);
  664.             _loc7_[1].push(wArray[2].seat);
  665.          }
  666.          if(_loc6_[0].a > _loc6_[1].a)
  667.          {
  668.             _loc7_[2].push(_loc6_[0].who);
  669.          }
  670.          else if(_loc6_[0].a < _loc6_[1].a)
  671.          {
  672.             _loc7_[2].push(_loc6_[1].who);
  673.          }
  674.          else if(_loc6_[0].a == _loc6_[1].a)
  675.          {
  676.             mygame.myhand.potStore[2] /= 2;
  677.             _loc7_[2].push(_loc6_[0].who);
  678.             _loc7_[2].push(_loc6_[1].who);
  679.          }
  680.          _loc7_[3].push(_loc6_[0].who);
  681.       }
  682.       else if(mygame.myhand.AllInActive == 4)
  683.       {
  684.          if(numTies == 0)
  685.          {
  686.             trace("if spot = 1");
  687.             _loc7_[0].push(wArray[0].seat);
  688.             _loc7_[1].push(wArray[0].seat);
  689.          }
  690.          else if(numTies == 1)
  691.          {
  692.             trace("if spot = 2");
  693.             mygame.myhand.potStore[0] /= 2;
  694.             mygame.myhand.potStore[1] /= 2;
  695.             _loc7_[0].push(wArray[0].seat);
  696.             _loc7_[0].push(wArray[1].seat);
  697.             _loc7_[1].push(wArray[0].seat);
  698.             _loc7_[1].push(wArray[1].seat);
  699.          }
  700.          else if(numTies == 2)
  701.          {
  702.             trace("if spot = 3");
  703.             mygame.myhand.potStore[0] /= 3;
  704.             mygame.myhand.potStore[1] /= 3;
  705.             _loc7_[0].push(wArray[0].seat);
  706.             _loc7_[0].push(wArray[1].seat);
  707.             _loc7_[0].push(wArray[2].seat);
  708.             _loc7_[1].push(wArray[0].seat);
  709.             _loc7_[1].push(wArray[1].seat);
  710.             _loc7_[1].push(wArray[2].seat);
  711.          }
  712.          else if(numTies == 3)
  713.          {
  714.             trace("if spot = 4");
  715.             mygame.myhand.potStore[0] /= 4;
  716.             mygame.myhand.potStore[1] /= 4;
  717.             _loc7_[0].push(wArray[0].seat);
  718.             _loc7_[0].push(wArray[1].seat);
  719.             _loc7_[0].push(wArray[2].seat);
  720.             _loc7_[0].push(wArray[3].seat);
  721.             _loc7_[1].push(wArray[0].seat);
  722.             _loc7_[1].push(wArray[1].seat);
  723.             _loc7_[1].push(wArray[2].seat);
  724.             _loc7_[1].push(wArray[3].seat);
  725.          }
  726.          var _loc24_ = false;
  727.          if(_loc6_[0].a == _loc6_[1].a && _loc6_[0].a == _loc6_[2].a)
  728.          {
  729.             trace("if spot = 5");
  730.             _loc24_ = true;
  731.             mygame.myhand.potStore[2] /= 3;
  732.             _loc7_[2].push(_loc6_[0].who);
  733.             _loc7_[20].push(_loc6_[1].who);
  734.             _loc7_[2].push(_loc6_[2].who);
  735.          }
  736.          if(_loc6_[0].a == _loc6_[1].a && _loc6_[0].a != _loc6_[2].a)
  737.          {
  738.             trace("if spot = 6");
  739.             _loc24_ = true;
  740.             mygame.myhand.potStore[2] /= 2;
  741.             _loc7_[2].push(_loc6_[0].who);
  742.             _loc7_[2].push(_loc6_[1].who);
  743.          }
  744.          if(_loc6_[0].a == _loc6_[2].a && _loc6_[0].a != _loc6_[1].a)
  745.          {
  746.             trace("if spot = 7");
  747.             _loc24_ = true;
  748.             mygame.myhand.potStore[2] /= 2;
  749.             _loc7_[2].push(_loc6_[0].who);
  750.             _loc7_[2].push(_loc6_[2].who);
  751.          }
  752.          if(_loc6_[1].a == _loc6_[2].a && _loc6_[1].a != _loc6_[0].a)
  753.          {
  754.             trace("if spot = 8");
  755.             _loc24_ = true;
  756.             mygame.myhand.potStore[2] /= 2;
  757.             _loc7_[2].push(_loc6_[2].who);
  758.             _loc7_[2].push(_loc6_[1].who);
  759.          }
  760.          if(_loc24_ == false)
  761.          {
  762.             if(_loc6_[0].a > _loc6_[1].a && _loc6_[0].a > _loc6_[2].a)
  763.             {
  764.                trace("if spot = 9");
  765.                _loc7_[2].push(_loc6_[0].who);
  766.             }
  767.             else if(_loc6_[1].a > _loc6_[0].a && _loc6_[1].a > _loc6_[2].a)
  768.             {
  769.                trace("if spot = 10");
  770.                _loc7_[2].push(_loc6_[1].who);
  771.             }
  772.             else if(_loc6_[2].a > _loc6_[1].a && _loc6_[2].a > _loc6_[0].a)
  773.             {
  774.                trace("if spot = 11");
  775.                _loc7_[2].push(_loc6_[2].who);
  776.             }
  777.          }
  778.          if(_loc6_[0].a > _loc6_[1].a)
  779.          {
  780.             trace("if spot = 12");
  781.             _loc7_[3].push(_loc6_[0].who);
  782.          }
  783.          else if(_loc6_[0].a < _loc6_[1].a)
  784.          {
  785.             trace("if spot = 13");
  786.             _loc7_[3].push(_loc6_[1].who);
  787.          }
  788.          else if(_loc6_[0].a == _loc6_[1].a)
  789.          {
  790.             trace("if spot = 14");
  791.             mygame.myhand.potStore[3] /= 2;
  792.             _loc7_[3].push(_loc6_[0].who);
  793.             _loc7_[3].push(_loc6_[1].who);
  794.          }
  795.          _loc7_[4].push(_loc6_[0].who);
  796.       }
  797.       trace("pot1  " + mygame.myhand.potStore[1]);
  798.       _loc4_ = 0;
  799.       while(_loc4_ < 5)
  800.       {
  801.          cashback = 0;
  802.          if(_loc4_ != 2)
  803.          {
  804.             mylost = table["chipBox" + _loc4_].enchilada;
  805.             if(mylost < 0)
  806.             {
  807.                mylost -= mylost * 2;
  808.             }
  809.             origmylost = mylost;
  810.             _loc5_ = 0;
  811.             while(_loc5_ < 5)
  812.             {
  813.                _loc8_ = 0;
  814.                while(_loc8_ < _loc7_[_loc5_].length)
  815.                {
  816.                   if(_loc7_[_loc5_][_loc8_] == _loc4_)
  817.                   {
  818.                      mylost -= mygame.myhand.potStore[_loc5_];
  819.                      cashback += mygame.myhand.potStore[_loc5_];
  820.                   }
  821.                   _loc8_ = _loc8_ + 1;
  822.                }
  823.                _loc5_ = _loc5_ + 1;
  824.             }
  825.             mygame.updateBalance(_loc4_,cashback,"pos");
  826.             if(mylost >= cashback)
  827.             {
  828.                table["pBox" + _loc4_].statusBox.display.text = "Lost " + _root.balanceFormat(mylost,0,",");
  829.                table["pBox" + _loc4_].statusBox.colorBox.gotoAndStop(1);
  830.             }
  831.             else if(cashback > origmylost)
  832.             {
  833.                var _loc9_ = cashback - origmylost;
  834.                table["pBox" + _loc4_].statusBox.display.text = "Won " + _root.balanceFormat(_loc9_,0,",");
  835.                table["pBox" + _loc4_].statusBox.colorBox.gotoAndStop(3);
  836.                table["pBox" + _loc4_].cover._visible = false;
  837.                table["chipBox" + _loc4_]._visible = true;
  838.             }
  839.             else
  840.             {
  841.                mylost = origmylost - cashback;
  842.                table["pBox" + _loc4_].statusBox.display.text = "Lost " + _root.balanceFormat(mylost,0,",");
  843.                table["pBox" + _loc4_].statusBox.colorBox.gotoAndStop(1);
  844.             }
  845.             if(_loc4_ == who && numTies == 0)
  846.             {
  847.                mygame.mybubble.makeBubble(6,winnerName + " Wins",_root.balanceFormat(_loc9_,0,","),3,2500);
  848.             }
  849.          }
  850.          _loc4_ = _loc4_ + 1;
  851.       }
  852.       arena.potBox.bal = 0;
  853.       arena.potBox.removeMovieClip();
  854.       if(numTies > 0)
  855.       {
  856.          mygame.mybubble.makeBubble(6,"Congratulations","winners!",3,2500);
  857.       }
  858.    }
  859.    else if(!tie)
  860.    {
  861.       var mylost;
  862.       var _loc10_ = undefined;
  863.       var _loc26_ = undefined;
  864.       var _loc11_ = 0;
  865.       var _loc19_ = 0;
  866.       _loc26_ = table["chipBox" + who].enchilada;
  867.       _loc10_ = _loc26_ - _loc26_ * 2;
  868.       _loc3_ = 0;
  869.       while(_loc3_ < mygame.myhand.handPlayers.length)
  870.       {
  871.          mylost = table["chipBox" + _loc3_].enchilada;
  872.          if(mylost < 0)
  873.          {
  874.             mylost -= mylost * 2;
  875.          }
  876.          if(mylost > _loc10_ && _loc3_ != who)
  877.          {
  878.             _loc11_ = mylost - _loc10_;
  879.             _loc19_ += _loc11_;
  880.             mygame.updateBalance(_loc3_,_loc11_,"pos");
  881.             table["pBox" + _loc3_].statusBox.display.text = "Lost " + _root.balanceFormat(_loc10_,0,",");
  882.          }
  883.          else
  884.          {
  885.             table["pBox" + _loc3_].statusBox.display.text = "Lost " + _root.balanceFormat(mylost,0,",");
  886.          }
  887.          table["pBox" + _loc3_].statusBox.colorBox.gotoAndStop(1);
  888.          _loc3_ = _loc3_ + 1;
  889.       }
  890.       _loc29_ = winnings + table["chipBox" + who].enchilada;
  891.       adjustedWinnings = arena.potBox.bal - _loc19_;
  892.       adjustedWinnings2 = adjustedWinnings - _loc10_;
  893.       mygame.updateBalance(who,adjustedWinnings,"pos");
  894.       table["pBox" + who].statusBox.display.text = "Won " + _root.balanceFormat(adjustedWinnings2,0,",");
  895.       table["pBox" + who].statusBox.colorBox.gotoAndStop(3);
  896.       table["pBox" + who].cover._visible = false;
  897.       table["chipBox" + who]._visible = true;
  898.       arena.potBox.bal = 0;
  899.       arena.potBox.removeMovieClip();
  900.       mygame.mybubble.makeBubble(6,winnerName + " Wins",_root.balanceFormat(adjustedWinnings2,0,","),3,2500);
  901.    }
  902.    else
  903.    {
  904.       var _loc13_ = 0;
  905.       var _loc25_ = arena.potBox.bal;
  906.       var _loc21_ = 0;
  907.       var _loc12_ = 0;
  908.       PlaySoundEffect("SOUND_CLAP3");
  909.       var mylost;
  910.       _loc3_ = 0;
  911.       while(_loc3_ < mygame.myhand.handPlayers.length)
  912.       {
  913.          mylost = table["chipBox" + _loc3_].enchilada;
  914.          if(mylost < 0)
  915.          {
  916.             mylost -= mylost * 2;
  917.          }
  918.          table["pBox" + _loc3_].statusBox.display.text = "Lost " + _root.balanceFormat(mylost,0,",");
  919.          table["pBox" + _loc3_].statusBox.colorBox.gotoAndStop(1);
  920.          _loc3_ = _loc3_ + 1;
  921.       }
  922.       var _loc23_ = new Array();
  923.       var _loc14_ = new Array();
  924.       _loc3_ = 0;
  925.       while(_loc3_ < numTies + 1)
  926.       {
  927.          _loc21_ += table["pBox" + _root["who" + _loc3_]].mybet;
  928.          _loc14_ = new Array({pos:_root["who" + _loc3_],amt:table["pBox" + _root["who" + _loc3_]].mybet});
  929.          _loc23_.push(_loc14_);
  930.          _loc3_ = _loc3_ + 1;
  931.       }
  932.       this.xtra0 = 0;
  933.       this.xtra1 = 0;
  934.       this.xtra2 = 0;
  935.       this.xtra3 = 0;
  936.       this.xtra4 = 0;
  937.       if(mygame.myhand.AllInActive > 0)
  938.       {
  939.          if(mygame.myhand.AllInPool[_root.who0] > mygame.myhand.AllInPool[_root.who1])
  940.          {
  941.             this["xtra" + _root.who0] = mygame.myhand.AllInPool[_root.who0] - mygame.myhand.AllInPool[_root.who1];
  942.             _loc25_ -= this["xtra" + _root.who0];
  943.          }
  944.          else if(mygame.myhand.AllInPool[_root.who1] > mygame.myhand.AllInPool[_root.who0])
  945.          {
  946.             this["xtra" + _root.who1] = mygame.myhand.AllInPool[_root.who1] - mygame.myhand.AllInPool[_root.who0];
  947.             _loc25_ -= this["xtra" + _root.who1];
  948.          }
  949.       }
  950.       trace("TOTAL POT  " + _loc25_);
  951.       trace("xtra - " + this["xtra" + _root.who0]);
  952.       trace("xtra - " + this["xtra" + _root.who1]);
  953.       _loc12_ = Math.floor((_loc25_ - _loc21_) / (numTies + 1));
  954.       _loc3_ = 0;
  955.       while(_loc3_ < numTies + 1)
  956.       {
  957.          _loc13_ = table["pBox" + _root["who" + _loc3_]].mybet + _loc12_ + this["xtra" + _root["who" + _loc3_]];
  958.          mygame.updateBalance(_root["who" + _loc3_],_loc13_,"pos");
  959.          _loc3_ = _loc3_ + 1;
  960.       }
  961.       _loc3_ = 0;
  962.       while(_loc3_ < numTies + 1)
  963.       {
  964.          table["pBox" + _root["who" + _loc3_]].statusBox.display.text = "Won " + _root.balanceFormat(_loc12_,0,",");
  965.          table["pBox" + _root["who" + _loc3_]].statusBox.colorBox.gotoAndStop(3);
  966.          _loc3_ = _loc3_ + 1;
  967.       }
  968.       arena.potBox.bal = 0;
  969.       arena.potBox.removeMovieClip();
  970.       mygame.mybubble.makeBubble(6,"Winners Each Get",_root.balanceFormat(_loc12_,0,","),3,2500);
  971.    }
  972.    DoScoreBroadcast();
  973.    var _loc20_ = _root.bigblind;
  974.    var _loc22_ = _root.ante;
  975.    if(nhrecord == blindincrement || nhrecord == blindincrement * 2 || nhrecord == blindincrement * 3 || nhrecord == blindincrement * 4 || nhrecord == blindincrement * 5 || nhrecord == blindincrement * 6 || nhrecord == blindincrement * 7 || nhrecord == blindincrement * 8 || nhrecord == blindincrement * 9)
  976.    {
  977.       var _loc27_ = betLevel + 1;
  978.       _loc20_ = prePay[_loc27_][0];
  979.       _loc22_ = prePay[_loc27_][2];
  980.    }
  981.    var _loc18_ = new Array();
  982.    xtraPot = 0;
  983.    _loc3_ = 0;
  984.    while(_loc3_ < mygame.myhand.handPlayers.length)
  985.    {
  986.       trace("balances - " + table["chipBox" + _loc3_].mybalance);
  987.       if(table["chipBox" + _loc3_].mybalance <= _loc20_ + _loc22_ && table["chipBox" + _loc3_].mybalance != undefined)
  988.       {
  989.          if(table["chipBox" + _loc3_].mybalance > 0)
  990.          {
  991.             xtraPot += table["chipBox" + _loc3_].mybalance;
  992.             table["chipBox" + _loc3_].mybalance = 0;
  993.          }
  994.          _loc18_.push(_loc3_);
  995.       }
  996.       _loc3_ = _loc3_ + 1;
  997.    }
  998.    if(_loc18_.length > 0)
  999.    {
  1000.       sayGoodbye(_loc18_);
  1001.       myallin.closeAllin();
  1002.    }
  1003.    else
  1004.    {
  1005.       getDealStandings();
  1006.       myallin.closeAllin();
  1007.    }
  1008. };
  1009. AllinScreen.prototype.closeAllin = function()
  1010. {
  1011.    var _loc1_ = undefined;
  1012.    _loc1_ = 0;
  1013.    while(_loc1_ < 5)
  1014.    {
  1015.       var _loc2_ = "card_comm_" + _loc1_;
  1016.       arena[_loc2_]._x = 175 + 50 * _loc1_;
  1017.       arena[_loc2_]._y = 175;
  1018.       _loc1_ = _loc1_ + 1;
  1019.    }
  1020.    allin.removeMovieClip();
  1021. };
  1022.